package com.android.settings.audio.peq.util;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;


/**
 * Created by We ( welee_911@163.com ) on 2023/12/5
 */
public class SmartPlayerApplication {
    private static Context context;
    public static void initContext(Context context){
        SmartPlayerApplication.context = context;
    }
    public static Context getInstance(){
        return context;
    }

    public static Handler getMainHandler(){
        return handler;
    }

    public static void runOnUiThread(Runnable runnable){
        if (Thread.currentThread() != handler.getLooper().getThread()) {
            handler.post(runnable);
        } else {
            runnable.run();
        }
    }

    private static Handler handler = new Handler(Looper.getMainLooper());
}
